Repository navigation
feat(release): v0.7.0 release foundation — version stamping, secret guard, release pipeline - #103
senolcolak wants to merge 12 commits into
Conversation
…uard, release pipeline Implements the top action items from docs/review/comprehensive-review-report-2026-10-12.md: R1 — version stamping (was: CRITICAL, every shipped binary unidentifiable): - main.Version var + lightstack --version flag + startup log - Dockerfile passes the VERSION build-arg into the binary via ldflags - the Makefile's existing -X main.Version injection now actually works - verified: make build -> --version round-trips the git-describe stamp; explicit -X stamps round-trip exactly; linux/arm64 cross-builds CGO-free S2 — refuse well-known/empty JWT secrets (was: HIGH, forged-admin takeover): - LoadConfig refuses the two literals shipped in config/lightstack.yaml and .env.example, and the empty secret, with an actionable error - LIGHTSTACK_ALLOW_INSECURE_DEFAULT_SECRET=1 is the documented escape hatch for isolated dev/test stacks - the stub-mode dev compose stack and 'make run' opt in explicitly with comments; the Horizon stack and Helm chart already require a real secret - unit tests: refusal pinned for all three values, escape hatch pinned, positive control for a random secret R3 — release pipeline (.github/workflows/release.yml): - tag-triggered (v*): test gate -> linux/amd64+arm64 binaries with checksums -> --version round-trip check -> multi-arch image to ghcr.io -> draft GitHub Release -> Helm chart published as OCI artifact with appVersion pinned to the tag R2 — chart version 0.3.0 -> 0.4.0 (annotated); appVersion 0.7.0 target Also: Horizon OPENSTACK_KEYSTONE_DEFAULT_ROLE _member_ -> member (matches the seeded admin/member/reader roles; _member_ matched nothing). make test: PASS (all unit tests, race detector) Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
C1 (CRITICAL): release.yml migrate build passed -s -w as top-level go
build flags — 'flag provided but not defined: -s' — and bash -e killed
the loop on the first iteration, so the pipeline could never produce
anything. Now -ldflags "-s -w" like the lightstack line.
H1: Dockerfile declared ARG VERSION only in the runtime stage, so the
builder stage's ${VERSION} expanded to empty and the image would carry
an unidentifiable binary — the exact failure class R1 exists to remove.
ARG VERSION=dev is now declared in the builder stage (annotated).
H2: the JWT-secret guard gated lightstack-migrate, breaking shipped
deployment paths that run it against the canned config before any secret
is wired in (image entrypoint CMD, the documented Kubernetes init
container, test/migration_test.sh). LoadConfig now delegates to a shared
loadConfig(path, enforceSecretGuard); the new
common.LoadConfigForMigration skips the guard — the tool never signs or
validates a token (it reads database.url and logging only). Pinned by
TestLoadConfigForMigrationSkipsSecretGuard.
M1: image was pushed as :v0.7.0 while the in-repo chart's appVersion
(0.7.0, no v) is what image.tag defaults to — a repo-direct helm install
would ImagePullBackOff forever. The workflow now computes
IMAGE_TAG=${GITHUB_REF_NAME#v} for the image tag and the chart's
--app-version; the binary keeps the full v-prefixed tag (consistent with
git describe stamps).
L1: deployments/docker/docker-compose.yaml also uses the default secret
without the escape hatch — added (with the same dev-only warning
comment).
L2: docs/review/comprehensive-review-report-2026-10-12.md was referenced
from the new code/comments but only existed on the docs branch — landed
in-tree (identical content on both branches; merges cleanly with
PR #101).
L3: release.yml action versions aligned with ci.yml (checkout@v6,
setup-go@v6).
L4: GitHub Release file glob narrowed to
dist/lightstack-<tag>-*-* + dist/checksums-* so the chart tarball can
never be absorbed by step reordering.
make test: PASS (all unit tests, race detector)
Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
F1 (HIGH, merge-blocker): the Horizon chart's bundled copy of local_settings (charts/horizon/files/) was left with _member_ — only the compose-path source was fixed. That both breaks 'make chart-test' (the horizon-chart-check step re-renders and diffs the bundled copy, so the helm-check CI job fails) and leaves the Helm/Kubernetes Horizon path unfixed entirely: the chart's ConfigMap mounts files/local_settings verbatim. Synced via 'make horizon-chart-sync' (the sync seds don't touch the role line; the only diff is _member_ -> member) and verified 'make chart-test' passes end to end (both charts lint+render+unittest, horizon files in sync). F2 (MEDIUM): the GitHub Release files glob dist/lightstack-<tag>-*-* does not match the lightstack-migrate-<tag>-* binaries — they were built and checksummed but never attached, and the checksums file would reference assets absent from the release. Added the migrate pattern. F3 (LOW): a bare 'docker run' of the image now requires LIGHTSTACK_JWT_SECRET (the server refuses the canned config's default — fail-closed by design). Documented above the Dockerfile CMD and in the CHANGELOG; lightstack-migrate in the entrypoint is exempt (never signs or validates a token). Verified: make chart-test PASS (helm 3.19 + helm-unittest), release.yml valid YAML; Go unit tests unaffected by this round (no Go changes). Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
M-1 (MEDIUM): the release test gate ran 'make test' on a bare runner —
no postgres service, no LIGHTSTACK_TEST_DB_URL, no -race — so every
DB-backed unit test silently t.Skip()-ed, and (ci.yml triggering only on
branches, not tags) the gate was the only test executed on a tag push.
The test job now mirrors ci.yml's unit job: postgres:18.3-alpine service,
LIGHTSTACK_TEST_DB_URL, 'go test -race', timeout-minutes 10.
L-1: the dev compose stacks enabled the escape hatch unconditionally —
even an operator passing a real LIGHTSTACK_JWT_SECRET ran with the guard
off. Now ${LIGHTSTACK_ALLOW_INSECURE_DEFAULT_SECRET:-true}: still ON by
default for dev UX, but settable to false/0 to re-arm the guard.
L-2: dist/ (release workflow output) was in neither .gitignore nor
.dockerignore — host-built binaries were dragged into the docker build
context and at risk of being committed. Added to both.
Hardening from the review's INFO items:
- job-scoped permissions: test gate now contents:read only; the
publishing job keeps contents+packages write
- concurrency group per tag (cancel-in-progress) so a re-pushed tag
cannot run two release pipelines in parallel
- timeout-minutes 30 on the release job
- corrected the release-files glob comment (checksums-* is not
tag-scoped, though it can only match checksum files)
make test: PASS (all unit tests, race detector); all three touched YAML
files parse cleanly.
Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
- header: chart appVersion is the bare version (no leading v), matching the image tag — the inline comment already said so, the header didn't - chart publish step: note that the chart lands in the org-level charts OCI namespace and relies on GITHUB_TOKEN packages:write covering it Final review round verdict: CLEAN (no Critical/High/Medium/Low correctness findings; these were informational notes on comment wording). Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
Review-fix loop summaryThis PR went through 4 comprehensive review rounds (independent deep reviews of the full diff). Verdicts:
Round 1 (fixed in
|
b1492f1 to
44ab893
Compare
Comprehensive-review follow-ups on this branch's own diff: - Secret guard: case-insensitive, whitespace-trimmed matching — the uppercase 'CHANGE-ME-IN-PRODUCTION' shipped in README-KVM.md was accepted (that example now generates a per-deployment secret, and its placeholder string is denylisted too). - Secret guard: also refuse a well-known/empty keystone.admin_password whenever an admin account is configured — admin/secret is public and authenticates as the bootstrap admin directly. New LIGHTSTACK_ADMIN_PASSWORD env override (mirroring LIGHTSTACK_JWT_SECRET) keeps the bare 'docker run' path workable; the Dockerfile CMD comment and the docs env-var table now say so. - CLI subcommands (cleanup, console-tokens) route through the unguarded loader like lightstack-migrate: they run on the server's host, whose config is only valid because the server's own process carries the escape hatch. - 'lightstack migrate' subcommand: deploy/upgrade scripts have always called it; the positional previously fell through to flag parsing and started the server instead of migrating. --dry-run prints 'No migrations to run' — the exact string upgrade-lightstack.sh greps. - Release workflow: lint, render and unit-test the charts (make chart-test — the same gate CI runs on PRs) before 'helm push', which cannot be undone. - Makefile .PHONY covers every target; guard tests are hermetic against a developer shell's exported LIGHTSTACK_JWT_SECRET / hatch, and pin the new admin-password behavior and the CLI exemption. Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
…ot path Round 2 of the comprehensive review on this branch: - F1 (HIGH): the admin-password guard had an omit-both-fields escape, but migrations/002 seeds an enabled admin/secret account in EVERY deployment and BootstrapAdmin only warns on an empty configured password — omitting the field is precisely how the public credential stays live. The guard now refuses empty/well-known admin_password unconditionally. The deploy scripts (deploy-single-node.sh, deploy-turnkey.sh) generate a real admin password (openssl rand) and carry it through the rendered config, the CLI env file and the summary; README-KVM's example documents both generated secrets (its placeholders are denylisted too). - F2 (HIGH): the CI rgw-integration stack booted the image's canned admin/secret with a real JWT secret and no opt-out — the new guard crash-looped it (job already red on the previous commit). The stack now arms the documented hatch, matching the dev-stack policy. - F3: docker-compose-horizon.yml requires LIGHTSTACK_ADMIN_PASSWORD like it requires the JWT secret; start_validation.sh and compose_db_identity_test.sh supply it; docker-compose.test.yml takes OS_PASSWORD from the environment instead of a hardcoded 'secret'. - F4: test/vxlan_multinode_test.sh arms the hatch (both fixture nodes boot admin/secret by design). - F5: 'lightstack migrate' rejects positional arguments — Go's flag parsing stops at the first one, so 'migrate up --config X --dry-run' silently ran a REAL migration against the DEFAULT config. - F6: runCleanup's doc comment reattached to runCleanup (it had drifted onto loadConfig). - F7: CONFIGURATION.md env-var table gains LIGHTSTACK_ADMIN_PASSWORD and the hatch variable; brittle 'exactly fourteen' count dropped. - F8: release concurrency queues (cancel-in-progress: false) — a cancelled in-flight publish between image and chart push is exactly the partial state the pipeline warns about. Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
…stack auth, boot-path docs - F1: the denylists missed repo-shipped placeholders in boot-path docs — docs/SINGLE_NODE_DEPLOYMENT.md and docs/SCALING.md JWT secrets, and the admin placeholder this branch itself added to README-KVM (its JWT sibling was denylisted, the admin one was not — a user who fixes only the JWT after the first refusal would boot with the repo-published admin credential). All three added, with test coverage. - F2: start_validation.sh boots the stack with a generated admin password (BootstrapAdmin replaces the seeded admin/secret hash), so the validation suite it runs must authenticate with the same password — OS_PASSWORD now defaults from LIGHTSTACK_ADMIN_PASSWORD, and the printed login lines no longer claim 'secret'. - F3: the copy-paste boot paths for docker-compose-horizon.yml now export both required secrets (README, QUICK_REFERENCE, UNIFIED_, HORIZON_SETUP); admin/secret login claims replaced with the actual source (the env var or /root/.lightstack-env, which the deploy script writes); .env.example gains the LIGHTSTACK_ADMIN_PASSWORD entry; the horizon compose SECRET_KEY comment no longer claims every caller drives the file without exporting anything. - F4: scripts/start-lightstack-background.sh boots the canned config with no opt-out — dead since the guard. Arms the documented hatch (same policy as make run), and documents that 'serve' is an ignored positional. Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
…st gaps - F1: HORIZON_SETUP and QUICK_REFERENCE still carried 'Default Credentials: admin/secret' blocks — a credential that can no longer log in to the stack their own quick starts boot (the horizon compose requires a real LIGHTSTACK_ADMIN_PASSWORD and the guard refuses admin/secret). Both blocks now point at the exported password. - F2: the horizon test scripts (horizon_compat, horizon_dashboard, horizon_critical, validation_suite) hardcoded admin/secret with no override — they now prefer OS_PASSWORD / LIGHTSTACK_ADMIN_PASSWORD (the pattern spec007_admin_bootstrap_test.sh already uses), so they keep working against the horizon stack and the hatch-armed dev stacks alike. horizon_critical's single-quoted JSON payloads splice the variable correctly. - F3: CONFIGURATION.md claimed 'there is no env override for these' 400 lines after the same file documented LIGHTSTACK_ADMIN_PASSWORD — reworded. - F4: two more repo-shipped example secrets denylisted (dev-secret-do-not-use-in-prod, USE-STRONG-RANDOM-SECRET) with test coverage. Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
- UNIFIED_DEPLOYMENT quick-start Step 5 still printed 'Password: secret' between two blocks that (since round 3) point at the exported LIGHTSTACK_ADMIN_PASSWORD — every user completing the quick start failed login at the final step. - horizon_dashboard_test.sh's success banner still instructed admin/secret after round 4 gave the script real-password support — now prints the credential it actually tested with. Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
Review-fix loop on this PR — converged CLEAN ✅This PR went through a fresh review-fix loop on top of its earlier rounds (the pre-loop history:
Round 1 — the foundation fixes
Round 2 — the significant one
Rounds 3–5 — convergence falloutDenylist gaps for repo-shipped doc placeholders (SINGLE_NODE/SCALING JWT secrets, both Round 6 — CLEANFinal sweep of all 41 changed files, full unit suite ( CI on the final commit: 10/10 checks green (incl. DCO, SAP Sign-off, the previously-failing Ceph RGW job). |
…lease path Review findings (comprehensive review of the open senolcolak PRs): - MEDIUM: 0.6.x configs have no keystone.admin_password, so script-deployed upgrades crash-loop under the new guard with no documented remedy. Add an UPGRADING.md section (exact error, both recovery routes, no-clobber guarantee), a CHANGELOG breaking-change callout, and an idempotent upgrade-script injection that backs up the config and generates a URL-safe password. - MEDIUM: the release workflow never reconciled Chart.yaml version with the tag; OCI tags are immutable, so the next release would fail after the image push and draft release. Add a pre-flight appVersion check before anything is built, and skip (with a warning) an already-published chart version. - MEDIUM: turnkey wrote real admin/JWT/DB secrets into a 0755 dir/0644 file and both scripts wrote 0644 env files. Use 0700/0600. - LOW: three current-state docs still presented admin/secret; scrub them and the other docs that implied it. - LOW: chart validation ran after the irreversible GHCR push and draft release; move it before the build, pin Helm 3.22.1 and helm-unittest 1.2.1 (matching CI), and clear the actionlint warnings. Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
…findings Review findings (comprehensive review of the open senolcolak PRs). These docs describe the post-#103 merged state, so #103 must merge first: - HIGH: Path B required only LIGHTSTACK_JWT_SECRET and logged in with admin/secret, but #103's horizon compose requires LIGHTSTACK_ADMIN_PASSWORD via :? and logs in with it. Require both secrets everywhere, generate them with openssl, and update the login instructions. CONFIGURATION's env table is now sixteen rows (adds ADMIN_PASSWORD and the dev-only hatch). - MEDIUM: shipped Horizon local_settings used _member_, a role that does not exist; both configs now use member (the seeded role). - MEDIUM: the documented rollback command no-ops — docker exec without -i gives the interactive down prompt EOF and exits 0. Feed yes and use -i. - MEDIUM: two [Unreleased] sections contradicted each other; fold the legacy v2.0 list into a clearly historical block. - MEDIUM: the contract-test README called a superseded report current; state the soft gate/85% floor and date the snapshot. - LOW: .env belongs beside the compose file, not the repo root; and the migration baseline was 059, not 055. Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
Shared CI unblocker for the open PRs (independent of this PR's content): - govulncheck now reports GO-2026-6809 in crypto/x509 (reachable through the HTTP server), fixed in Go 1.27.3. Main pins 1.27.2 everywhere, so every PR's Runtime Vulnerabilities and SBOM job fails. Pin 1.27.3 in go.mod, tools/go.mod, CI workflows, the builder image, the test container and the single-node deploy script (version + sha256). - The unpinned Helm install now pulls Helm 4, whose 'helm plugin install' rejects the helm-unittest source without --verify=false, failing the Helm Charts job with 'plugin source does not support verification'. Install Helm 3.22.1 and helm-unittest 1.2.1 in an isolated plugin dir, matching PR #107, so the gate is version-stable. Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
Comprehensive review — findings fixedReviewed against Found 7 (5 Medium, 2 Low) — all fixed in
Not fixed (coordination, no renumbering):
CI unblocker included ( CI: 10/10 green. |
Reopened from
feat/v0.7.0-release-foundation(supersedes #102 — the newrequire-one-approvalruleset matchesrefs/heads/release/*and blocks direct pushes to the old branch name; identical content plus the review-round-1 fixes).Implements the top action items from the comprehensive review (
docs/review/comprehensive-review-report-2026-10-12.md). Companion to the docs PR #101.R1 — Version stamping (was CRITICAL)
The Makefile has always passed
-ldflags "-X main.Version=...", but novar Versionexisted — Go silently ignores-Xfor undefined symbols, so every shipped binary was unidentifiable.var Version = "dev"incmd/lightstack/main.go,lightstack --versionflag, startup log lineVERSIONbuild-arg into the binary — declared in the builder stage (an ARG in the runtime stage is out of scope for the build RUN and expands to empty)make build→--versionround-trips the git-describe stamp; explicit-X main.Version=v0.7.0-testround-trips exactly;CGO_ENABLED=0 GOOS=linux GOARCH=arm64builds (what the release workflow does — Ceph RBD sits behind thecephbuild tag)S2 — Refuse well-known/empty JWT secrets (was HIGH)
config/lightstack.yamland.env.exampleship public default secrets; tokens are stateless, so knowing the secret = minting admin tokens. The old code only warned, and only on one of the two literals.LoadConfignow refuses both shipped literals and the empty secret, with an actionable error messageLIGHTSTACK_ALLOW_INSECURE_DEFAULT_SECRET=1is the documented escape hatch for isolated dev/testmake runopt in explicitly (commented); the Horizon stack and Helm chart already require a real secret; deploy scripts already generate random secretslightstack-migrateis exempt (LoadConfigForMigration): it never signs or validates a token, and the image entrypoint and the documented Kubernetes init container run it against the canned config before any secret is wired inR3 — Release pipeline (
.github/workflows/release.yml)Push a
v*tag → test gate → linux/amd64+arm64 binaries + checksums →--versionround-trip guard (R1 regression protection) → multi-arch image toghcr.io→ draft GitHub Release → Helm chart published as OCI artifact. Image tag and chartappVersioncarry the bare version (0.7.0) to match the in-repo chart'sappVersion/image.tagdefault; the binary reports the fullv0.7.0.R2 — Chart alignment
Chart.yaml0.3.0 → 0.4.0 (annotated history);appVersion: 0.7.0— becomes true when v0.7.0 is tagged.Also
OPENSTACK_KEYSTONE_DEFAULT_ROLE:_member_→member(matches seeded roles;_member_matched nothing)docs/review/comprehensive-review-report-2026-10-12.md, identical to the copy on docs: overhaul all documentation to current project state + installation quickstart #101 — merges cleanly)Review status
Round 1 findings (1 Critical, 2 High, 1 Medium, 4 Low) all fixed in the second commit — see its message for the item-by-item mapping.
Testing
make test— PASS (full unit suite, race detector), after every fix roundhelm templatewith required values — renders clean (helm lintfails on emptyimage.repositoryby design, FR-018, pre-existing)After merge
Tag
v0.7.0→ the pipeline produces the release; recommend also deleting the stalev1.0.0tag (451+ commits behind, misleading latest).Not in scope (tracked in the review report)
S1 token revocation, S4 rate limiting, C1/C2 shutdown races — follow-up PRs.